Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend [Integration Test] bounty.go handlers GetPersonCreatedBounties, GetPersonAssignedBounties, & GetBountyByCreated #1544

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

AbdulWahab3181
Copy link
Contributor

…tBountyByCreated

Describe your changes

Added Unit test for bounty handler to test GetPersonCreatedBounties, GetPersonAssignedBounties and GetBountyByCreated methods

Issue ticket number and link

Closes #1509

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have tested on a mobile device
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

@AbdulWahab3181 AbdulWahab3181 marked this pull request as ready for review February 21, 2024 11:25
Copy link
Contributor

@kevkevinpal kevkevinpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the most part this PR is good, would be better if we were asserting the exact response but we're already mocking the db so not sure how good of a test that would be.

I need to double check that we're testing the failure scenarios since those are important aswell

Comment on lines +654 to +655
assert.NotEmpty(t, responseData)
assert.Len(t, responseData, 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just notice that we're not asserting the exact response but just the length and that we have a value coming back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevkevinpal Added additional assertions to validate the exact response.

Comment on lines +517 to +518
assert.NotEmpty(t, responseData)
assert.Len(t, responseData, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed that we dont assert the exact value here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevkevinpal Added additional assertions to validate the response

Comment on lines +744 to +745
assert.NotEmpty(t, responseData)
assert.Len(t, responseData, 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with just then lenght and a value being passed back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevkevinpal Added additional assertions to validate the response

Comment on lines +773 to +774
assert.Empty(t, responseData)
assert.Len(t, responseData, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with this assertion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is not need as the response data is already empty

@elraphty elraphty merged commit 204eb81 into stakwork:master Feb 23, 2024
1 check passed
@ecurrencyhodler
Copy link
Contributor

Paid 200k sats! https://community.sphinx.chat/bounty/1479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants